﻿using SIPSorcery.SIP;
using SIPSorcery.SIP.App;
using System;
using System.Collections.Generic;
using System.Text;

namespace SIPSorcery.GBdemo.SIPServer
{
    public class SIPAccountBinding
    {
        public SIPRequest SIPRequest { get; set; }
        public SIPAccount SIPAccount { get; set; }
        public SIPURI RegisteredContact { get; set; }
        public SIPEndPoint RemoteEndPoint { get; set; }
        public SIPEndPoint LocalEndPoint { get; set; }
        public int Expiry { get; set; }

        /// <summary>
        /// 用于记录 INVITE 通信过程中的 CallId;
        /// </summary>
        public string CallId { get; set; }

        public string FromTag { get; set; }
        public string ToTag { get; set; }

        /// <summary>
        /// 是否发起过直播;
        /// </summary>
        public bool IsLived { get; set; }

        public SIPAccountBinding(SIPRequest sipRequest, SIPAccount sipAccount, SIPURI contact, SIPEndPoint remote, SIPEndPoint local, int expiry)
        {
            SIPRequest = sipRequest;
            SIPAccount = sipAccount;
            RegisteredContact = contact;
            RemoteEndPoint = remote;
            LocalEndPoint = local;
            Expiry = expiry;
        }
    }
}